
package com.joysuch.wwyt.datadump.biz.convertor;

import java.util.Collections;
import java.util.List;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import com.joysuch.wwyt.core.repository.BaseTypeGroupItemDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ExportBaseTypeGroupItemNameBatchConvertor implements FieldValueConvert<List<Long>, List<String>> {

    @Autowired
    private BaseTypeGroupItemDao dao;

    @Override
    public List<String> convert(Object bean, List<Long> value, DataDumpField dataField) {
        if (value == null || value.isEmpty()) {
            return Collections.EMPTY_LIST;
        }
        return dao.findNameByIdIn(value);
    }

}
